﻿using System.IO;
using System.Windows.Input;
using PSE.Deployment.ConfigurationManager.Controls;
using PSE.Deployment.SetupBase;
using PSE.Deployment.SetupBase.UI;
using PSEComponents.Deployment.Setup.Main;

namespace PSEComponents.Deployment.Setup.UI
{
    public partial class Introduction : BaseWizardWindow
    {
        #region Construtor

        public Introduction()
		{
			this.InitializeComponent();
            this.AllowNext = true;            
        }

        #endregion

        #region Método para abrir o Manual de Instalação
        
        private void LblGuide_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            string fileName = SetupMainFactory.GetInstance<PSEComponentsMain>().Parameter.InstalationSource + @"\Guides\pt-br\InstallationGuide.pdf";

            if (File.Exists(fileName))
            {
                System.Diagnostics.Process process = new System.Diagnostics.Process();
                process.StartInfo.FileName = fileName;
                process.Start();
            }
            else
            {
                ConfigurationMessageBox.Show(string.Format("Não foi possível localizar o arquivo {0}", fileName), "Atenção", ConfigurationMessageBoxButton.Ok, ConfigurationMessageBoxImage.Exclamation);
            }
        }

        #endregion
    }
}
